package com.xy.order.controller;

import com.ruoyi.common.core.domain.order.vo.Cleaning;
import com.ruoyi.common.core.domain.user.Address;
import com.ruoyi.common.core.web.controller.BaseController;
import com.xy.order.service.dto.TakeOrderService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 控制用户下单
 */

@RestController
@RequestMapping("/takeOrders")
public class TakeOrdersController extends BaseController {
    @Autowired
    private TakeOrderService takeOrderService;

    /**
     * 获取所有用户可下单的服务
     * @param cleaning
     * @return
     */
    @GetMapping("/list")
    public List<Cleaning> listCleanings(Cleaning cleaning)
    {
        return takeOrderService.listCleanings(cleaning);
    }

    /**
     * 获取用户地址
     */
    @GetMapping("/listUserAddresses01")
    public List<Address> listUserAddresses01(Long userId)
    {
        return takeOrderService.listUserAddresses01(userId);
    }
}
